package it.webrules.deploymanager.core.st.scm;

import java.util.ArrayList;
import java.util.List;

public class Status {

	public Long remoteRevision;
	public List<StatusEntry> entries;

	public Status() {
		entries = new ArrayList<StatusEntry>();
	}

	@Override
	public String toString() {

		StringBuilder sb = new StringBuilder();

		sb.append("Flags       | WorkRev |  LastCh |      Author     |       Path\n");
		sb.append("-----------------------------------------------------------------------\n");

		for (StatusEntry entry : entries)
			sb.append(entry.toString() + "\n");

		if (entries.size() == 0)
			sb.append("No changes.\n");

		if (remoteRevision != null && remoteRevision != -1)
			sb.append("Status against revision:  " + remoteRevision + ".\n");

		return sb.toString();
	}

}
